<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script>
//1、动态显示当前时间
//   xxxx年xx月xx日 xx时xx分xx秒
function showtime(){
	var d = new Date();
	var year = d.getFullYear();
	var mon = d.getMonth()+1;
	var day = d.getDay();
	var hour = d.getHours();
	var minute = d.getMinutes();
	var sec = d.getSeconds();
	//不足2位，补0;
	mon = mon<10?"0"+mon:mon;
	day = day<10?"0"+day:day;
	hour = hour<10?"0"+hour:hour;
	minute = minute<10?"0"+minute:minute;
	sec = sec<10?"0"+sec:sec;
	
	var str = year+"年"+mon+"月"+day+"日"+hour+"时"+minute+"分"+sec+"秒";
	
	document.body.innerHTML = str;
}
setInterval("showtime()",1000);
</script>